﻿<local:BaseWindow
    x:Class="LenovoLegionToolkit.WPF.Windows.Settings.SelectSmartKeyPipelinesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:LenovoLegionToolkit.WPF.Controls"
    xmlns:local="clr-namespace:LenovoLegionToolkit.WPF.Windows"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:utils="clr-namespace:LenovoLegionToolkit.WPF.Utils"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    Width="400"
    Height="500"
    MinWidth="400"
    MinHeight="500"
    FlowDirection="{x:Static utils:LocalizationHelper.Direction}"
    ResizeMode="CanMinimize"
    ShowInTaskbar="False"
    WindowStartupLocation="CenterOwner">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <wpfui:TitleBar
            Grid.Row="0"
            CanMaximize="false"
            ShowMaximize="false"
            ShowMinimize="false"
            UseSnapLayout="false" />

        <Grid
            Grid.Row="0"
            Height="24"
            Margin="12,8,12,8">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock
                x:Name="_title"
                Grid.Column="0"
                VerticalAlignment="Center"
                FontSize="12"
                IsHitTestVisible="False" />
        </Grid>

        <Grid Grid.Row="1" Margin="12,0,16,0">

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <wpfui:CardControl Grid.Row="0" Margin="0,0,0,24">
                <wpfui:CardControl.Header>
                    <controls:CardHeaderControl Title="{x:Static resources:Resource.SelectSmartKeyPipelinesWindow_ShowThisApp}" />
                </wpfui:CardControl.Header>
                <wpfui:ToggleSwitch x:Name="_showThisAppToggle" Click="ShowThisAppToggle_Click" />
            </wpfui:CardControl>

            <TextBlock
                Grid.Row="1"
                Margin="0,0,0,8"
                Foreground="{DynamicResource TextFillColorSecondaryBrush}"
                Text="{x:Static resources:Resource.SelectSmartKeyPipelinesWindow_List_Description}"
                TextWrapping="Wrap" />

            <controls:LoadableControl
                x:Name="_loader"
                Grid.Row="2"
                Margin="0,0,0,8"
                IndicatorVerticalAlignment="Center">

                <Border CornerRadius="8">
                    <Border.Background>
                        <SolidColorBrush Color="{DynamicResource ControlFillColorDefault}" />
                    </Border.Background>

                    <wpfui:DynamicScrollViewer>
                        <ItemsControl
                            x:Name="_list"
                            Margin="8,8,16,0"
                            HorizontalContentAlignment="Stretch" />
                    </wpfui:DynamicScrollViewer>
                </Border>

            </controls:LoadableControl>
        </Grid>

        <Grid Grid.Row="2" Margin="12">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <wpfui:Button
                Grid.Column="1"
                MinWidth="100"
                Appearance="Primary"
                Click="SaveButton_Click"
                Content="{x:Static resources:Resource.Save}" />

            <wpfui:Button
                Grid.Column="2"
                MinWidth="100"
                Margin="8,0,0,0"
                Click="CancelButton_Click"
                Content="{x:Static resources:Resource.Cancel}" />
        </Grid>
    </Grid>
</local:BaseWindow>
